#!/bin/bash
[[ -x '/bin/df' ]] || exit 0
while read LINE; do
	for ARG in "$@"; do
		read AINUSE APATH <<< "$ARG"
		read DEV JUNK JUNK JUNK JUNK INUSE PATH <<< "$LINE"
		if [[ "$PATH" == "$APATH" ]]; then
			INUSE="${INUSE%%%}"
			(( INUSE > AINUSE )) && echo "device '$DEV' mounted at $PATH: ${INUSE}% in use (redline at ${AINUSE}%)"
		fi
	done
done < <(/bin/df --local --print-type --block-size=1M | tail --lines=+2)
